package mapdemo;

import java.time.LocalDate;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;

import org.junit.Test;

public class MapDemo {

	@Test
	public void personsMap() {
		// key是车牌号，Value是Car: 品牌，型号，颜色，排量double
		// Map中添加5个车，遍历整个map
		Map<String,Person> map = new HashMap<>();
		map.put("11231836186321", new Person("zs",'女',"dalian"));
		map.put("11231836186322", new Person("zs",'女',"dalian"));
		map.put("11231836186323", new Person("zs",'女',"dalian"));
		map.put("11231836186324", new Person("zs",'女',"dalian"));
		map.put("11231836186325", new Person("zs",'女',"dalian"));
		
		Set<Entry<String, Person>> personSet = map.entrySet();
		Iterator<Entry<String, Person>> it = personSet.iterator();
		while (it.hasNext()) {
			Entry<String, Person> entry = it.next();
			System.out.println("身份证号:" + entry.getKey() + "," + entry.getValue());
		}
	}
}
